<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>评论列表</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-select/js/bootstrap-select.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-select/lang/defaults-zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-select/css/bootstrap-select.min.css" />

    <script src="${base}/jstool/artDialog/src/dialog.js"></script>
    <style type="text/css">
        .table-class{
            width:90%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        table th{
            text-align: center;
            WORD-WRAP: break-word;
            width: 100px;
        }
        table thead tr {
            background-color: #9acfea;
        }
        .table-query{
            /*height: 40px;*/
            /*width:80px;*/
            /*text-align: center;*/
            white-space:nowrap;
            /*position: relative;*/
            float: left;
            display:inherit;
            /*display: inline;*/


        }
        .label-head{
            height: 60px;
            width: 100%;
        }
        .bs-example .input-group{
            width:300px;
            float: left;
            margin-top:20px;

        }
        .bank-label{
            width:25px;
            float: left;
        }
        .label-hidden{
            display: none;
        }
        .panel-body{
            padding-top: 0px;
        }
        .input-group input[type='text']{
            z-index: inherit;
        }
       /* .input-group{
            margin-top:20px;
        }*/
    </style>
    <script type="text/javascript">
        function query(dm){
            var href = "${base}/czjcomments/list.do?";

            href+='content='+$('#content').val();
                    href+='&'



            href+='userinfoId='+$('#userinfoId').val();
                    href+='&'

            href+='objectId='+$('#objectId').val();
                    href+='&'

            href+='objectType='+$('#objectType').val();
                    href+='&'

            href+='approveStatus='+$('#approveStatus').val();
                    href+='&'

            href+='approveTimeStart='+$('#approveTimeStart').val()+"&";
            href+='approveTimeEnd='+$('#approveTimeEnd').val();
                    href+='&'

            href+='createtimeStart='+$('#createtimeStart').val();
            href+='createtimeEnd='+$('#createtimeEnd').val();


            location.href=href;
        }
        $(function() {
            //初始化
                $('#approveTimeStart').datetimepicker({language: 'zh-CN' });
                $('#approveTimeEnd').datetimepicker({language: 'zh-CN' });
                $('#createtimeStart').datetimepicker({language: 'zh-CN' });
                $('#createtimeEnd').datetimepicker({language: 'zh-CN' });
        });
    </script>
</head>
<body>

<#include "/view/admin/listnav.html"/>

<div class="table-class">
    <div hidden class="panel panel-default" style="margin: 10px 50px 10px;">
        <div class="panel-body">
            <form class="bs-example bs-example-form" role="form">

                <div class="input-group">
                    <span class="input-group-addon">评论内容</span>
                    <input type="text" id="content" class="form-control" value="${entity.content!}" placeholder="请输入评论内容">
                </div>
                <span class="bank-label">&nbsp;</span>



              <#--  <div class="input-group">
                    <span class="input-group-addon">用户</span>
                    <select id="userinfoId" name="userinfoId"
                            class="form-control selectpicker"   data-live-search="true"
                    >
                        <option value="">请选择用户</option>
                        <#list listUserinfoId as lv>
                            <option value="${lv.value!}"
                            <#if entity.userinfoId??&&entity.userinfoId == lv.value >
                                selected="selected"
                            </#if>
                            >${lv.name!}</option>
                        </#list>

                    </select>

                </div>
                <span class="bank-label">&nbsp;</span>-->


                <div class="input-group">
                    <span class="input-group-addon">评论对象</span>
                    <input type="text" id="objectId" class="form-control" value="${entity.objectId!}" placeholder="请输入评论对象">
                </div>
                <span class="bank-label">&nbsp;</span>

                <div class="input-group">
                    <span class="input-group-addon">评论对象类别</span>
                    <select id="objectType" name="objectType"
                            class="form-control"
                    >
                        <option value="">请选择评论对象类别</option>
                        <option value="0" <#if entity.objectType??&&0 == entity.objectType>selected="selected"</#if>>活动</option>

                        <option value="1" <#if entity.objectType??&&1 == entity.objectType>selected="selected"</#if>>商品</option>


                    </select>

                </div>
                <span class="bank-label">&nbsp;</span>


                <div class="input-group">
                    <span class="input-group-addon">审批状态</span>
                    <select id="approveStatus" name="approveStatus"
                            class="form-control"
                    >
                        <option value="">请选择审批状态</option>
                        <option value="0" <#if entity.approveStatus??&&0 == entity.approveStatus>selected="selected"</#if>>审批中</option>

                        <option value="1" <#if entity.approveStatus??&&1 == entity.approveStatus>selected="selected"</#if>>审批通过</option>

                        <option value="2" <#if entity.approveStatus??&&2 == entity.approveStatus>selected="selected"</#if>>审批不通过</option>


                    </select>

                </div>
                <span class="bank-label">&nbsp;</span>


                <div class="input-group">
                    <span class="input-group-addon">开始审批时间</span>
                    <input type="text" id="approveTimeStart" class="form-control" value="<#if (entity.approveTimeStart)?? >${entity.approveTimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="approveTimeStart" name="approveTimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
                <div class="input-group">
                    <span class="input-group-addon">结束审批时间</span>
                    <input type="text" id="approveTimeEnd" class="form-control" value="<#if (entity.approveTimeEnd)?? >${entity.approveTimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="approveTimeEnd" name="approveTimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>

                <div class="input-group">
                    <span class="input-group-addon">开始创建时间</span>
                    <input type="text" id="createtimeStart" class="form-control" value="<#if (entity.createtimeStart)?? >${entity.createtimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtimeStart" name="createtimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
                <div class="input-group">
                    <span class="input-group-addon">结束创建时间</span>
                    <input type="text" id="createtimeEnd" class="form-control" value="<#if (entity.createtimeEnd)?? >${entity.createtimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtimeEnd" name="createtimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>


                <div class="input-group" style="text-align: right;">
                    <a class="btn btn-info"  href="javascript:query(this)"><span class="glyphicon glyphicon-search"></span> 查找</a>

                </div>
            </form>
        </div>
    </div>
<#include "/view/admin/opermsg.html"/>


    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>序号</th>
                <th class="label-hidden">评论主键</th>
                <th>评论内容</th>
                <th>回复数</th>
                <th>点赞数</th>
                <th>用户</th>
                <th>评论对象</th>
                <th>评论对象类别</th>
                <th>审批状态</th>
                <th>审批时间</th>
                <th>创建时间</th>

            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <#list pagination.list as c>
            <tr>
                <td>${(pagination.pageNo-1)*pagination.pageSize+1+c_index}</td>
                        <td class="label-hidden">${c.commentsId!}</td>
                            <td>${c.content!}</td>

                            <td>${c.replyCount!}</td>

                            <td>${c.likeCount!}</td>

                        <td> 
                            <#if c.userinfoId??>
                                    <#list listUserinfoId as lv>
                                        <#if lv.value??&&c.userinfoId == lv.value >
                                        ${lv.name!}
                                        </#if>
                                    </#list>

                            </#if>


                        </td>
                            <td>${c.objectId!}</td>

                        <td> 

                            <#if c.objectType??>
                                        <#if c.objectType==0>活动
                                        <#elseif c.objectType==1>商品
                                        </#if>

                            </#if>

                        </td>
                        <td>
                            <#if c.approveStatus??>
                                <#if 0==c.approveStatus><span class="label label-default">待审批中</span>
                                    <#elseif 1==c.approveStatus><span class="label label-success">审批通过</span>
                                        <#elseif 2==c.approveStatus><span class="label label-danger">审批不通过</span>
                                </#if>
                            </#if>
                        </td>
                        <td><#if c.approveTime?? >${c.approveTime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
                        <td><#if c.createtime?? >${c.createtime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>

                <td>
                    <a href="${base}/czjreply/list2.do?commentsId=${c.commentsId!}" class="btn btn-primary">回复列表</a>
                    <a href="${base}/czjcommentspic/list2.do?commentsId=${c.commentsId!}" class="btn btn-primary">图片列表</a>
                    <a href="${base}/czjcommentsvideo/list2.do?commentsId=${c.commentsId!}" class="btn btn-primary">视频列表</a>
                    <!--<a href="${base}/czjcomments/detail.do?commentsId=${c.commentsId!}" class="btn btn-primary">详情</a>-->
                </td>
            </tr>


        </#list>
        <#if 0==pagination.totalCount>
            <tr>
                <td colspan="7" style="color: red"> 没有相关数据 </td>
            </tr>
        </#if>





        </tbody>
    </table>
        <!--<span style="text-align: left"> <a href="#" class="btn btn-primary">新增</a></span>-->
<#include "/view/admin/pagination.html"/>

</div>
<script>
    function setPage(pageNo,pageSize){
        var href = "${base}/czjcomments/list.do?";

            href+='content='+$('#content').val()+"&";




            href+='objectId='+$('#objectId').val()+"&";



            href+='approveTimeStart='+$('#approveTimeStart').val()+"&";
            href+='approveTimeEnd='+$('#approveTimeEnd').val()+"&";

            href+='createtimeStart='+$('#createtimeStart').val();
            href+='createtimeEnd='+$('#createtimeEnd').val();

        href+="&pageNo="+pageNo;
        href+="&pageSize="+pageSize;
        location.href=href;
    }
    function checkDelete(url){
        if (window.confirm("确认删除吗?")) {
            location.href=url;
        }
    }

</script>

</body>
</html>
